
package cs.remoteapp;
/**
 * The FileAnswer class permits the user to accept or reject a download
 * @author      4INFO - A1
 * @version     1.0
 */
public class FileAnswer extends Message {
	/**
	 * Serialization id
	 */
	private static final long serialVersionUID = 8628194123083819362L;
	/**
	 * Name of the file
	 */
	private String fileName;
	/**
	 * FileRequest answer. If it is set to true then the download is accepted, 
	 * otherwise the download is rejected.
	 */
	private boolean fileAccepted;
	
	/**
	 * constructor
	 * @param username Name of the sender
	 * @param fileName File name
	 * @param answer True if the download is accepted, false otherwise
	 */
	public FileAnswer(String username, String fileName, boolean answer) {
		super(username);
		this.fileName = fileName;
		this.fileAccepted = answer;
	}

	/**
	 * Get the file name
	 * @return The file name
	 */
	public String getFileName() {
		return fileName;
	}

	/**
	 * Get the FileRequest answer
	 * @return true if the download is accepted, false otherwise
	 */
	public boolean isAccepted() {
		return fileAccepted;
	}
}
